class Stack:
    def __init__(self):
        self.items = []

    def push(self,x):
        self.items.append(x)

    def pop(self):
        if not self.empty():
            x = self.items[-1]
            del self.items[-1]
            return x
        else:
            return None
    def empty(self):
        return len(self.items) == 0
    
class StackLimite(Stack):
    def __init__(self,limit):
        self.limit = limit
        Stack.__init__(self)
    def push(self,x):
        assert len(self.items) < self.limit
        Stack.push(self,x)
        


